package Vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaRegistrarArbitro extends javax.swing.JFrame {
	private JPanel panArbitro;
	private JLabel jlbarbitro;
	private JLabel lbldivision2;
	private JTextField txtNombre;
	private JLabel lbldivision1;
	private JButton btnRegistrar;
	private JTextField txtAnno;
	private JTextField txtMes;
	private JTextField txtDia;
	private JLabel lblFechanacimiento;
	private JTextField txtApellido;
	private JLabel lblApellido;
	private JLabel lblNombre;
	private JTextField txtCedula;
	private JLabel lblCedula;

	/**
	* Auto-generated main method to display this JFrame
	*/
	
	
	public VentanaRegistrarArbitro() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panArbitro = new JPanel();
				getContentPane().add(panArbitro, BorderLayout.CENTER);
				panArbitro.setPreferredSize(new java.awt.Dimension(397, 279));
				panArbitro.setLayout(null);
				panArbitro.setBackground(new java.awt.Color(197,229,249));
				{
					lblCedula = new JLabel();
					panArbitro.add(lblCedula);
					lblCedula.setText("Cedula:");
					lblCedula.setBounds(41, 71, 81, 15);
				}
				{
					txtCedula = new JTextField();
					panArbitro.add(txtCedula);
					txtCedula.setBounds(164, 68, 145, 22);
				}
				{
					lblNombre = new JLabel();
					panArbitro.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(41, 122, 81, 19);
				}
				{
					txtNombre = new JTextField();
					panArbitro.add(txtNombre);
					txtNombre.setBounds(164, 121, 205, 22);
				}
				{
					lblApellido = new JLabel();
					panArbitro.add(lblApellido);
					lblApellido.setText("Apellido:");
					lblApellido.setBounds(41, 180, 76, 15);
				}
				{
					txtApellido = new JTextField();
					panArbitro.add(txtApellido);
					txtApellido.setBounds(164, 173, 205, 22);
				}
				{
					lblFechanacimiento = new JLabel();
					panArbitro.add(lblFechanacimiento);
					lblFechanacimiento.setText("Fecha de Nacimiento:");
					lblFechanacimiento.setBounds(6, 230, 176, 19);
				}
				{
					txtDia = new JTextField();
					panArbitro.add(txtDia);
					txtDia.setBounds(165, 229, 55, 22);
				}
				{
					txtMes = new JTextField();
					panArbitro.add(txtMes);
					txtMes.setBounds(258, 227, 51, 24);
				}
				{
					txtAnno = new JTextField();
					panArbitro.add(txtAnno);
					txtAnno.setBounds(369, 225, 83, 26);
				}
				{
					btnRegistrar = new JButton();
					panArbitro.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(202, 281, 122, 58);
					btnRegistrar.setBackground(new java.awt.Color(255,255,255));
				}
				{
					lbldivision1 = new JLabel();
					panArbitro.add(lbldivision1);
					lbldivision1.setText("/");
					lbldivision1.setBounds(232, 222, 20, 35);
					lbldivision1.setFont(new java.awt.Font("Bitstream Charter",0,22));
				}
				{
					lbldivision2 = new JLabel();
					panArbitro.add(lbldivision2);
					lbldivision2.setText("/");
					lbldivision2.setBounds(333, 218, 24, 39);
					lbldivision2.setFont(new java.awt.Font("Bitstream Charter",0,22));
				}
				{
					jlbarbitro = new JLabel();
					panArbitro.add(jlbarbitro);
					jlbarbitro.setText("DATOS DEL ARBITRO");
					jlbarbitro.setBounds(136, 12, 274, 29);
					jlbarbitro.setFont(new java.awt.Font("Bitstream Charter",0,20));
				}
			}
			pack();
			setSize(500, 400);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	//Getters
	
    public String getCedula(){
    	
    	return txtCedula.getText();
    }
	
	public String getNombre()
	{
		
		return txtNombre.getText();
		
	}
	public String getApellido(){
		
		return txtApellido.getText();
		
	}
	public String getDia(){
		
		return txtDia.getText();
	
	}
	public String getMes(){
		
		return txtMes.getText();
		
	}
	public String getAnno(){
		
		return txtAnno.getText();
		
	}
	
	public void mostrarMensaje(String mensaje){
		
		JOptionPane.showMessageDialog(this, mensaje);
		
	}
	
	public void agregarListener (ActionListener accion){
		
		btnRegistrar.addActionListener(accion);
	}
	
	public void limpiarPantalla (){
		
		txtCedula.setText("");
		txtNombre.setText("");
		txtApellido.setText("");
		txtDia.setText("");
		txtMes.setText("");
		txtAnno.setText("");
		
	
		
		
	}
	
	public boolean CampoBlanco()
	{
		boolean blanco= false;
		if((txtMes.getText().compareTo("")== 0)||(txtDia.getText().compareTo("") == 0)||(txtAnno.getText().compareTo("") == 0)||(txtNombre.getText().compareTo("") == 0)||(txtApellido.getText().compareTo("") == 0)||(txtCedula.getText().compareTo("") == 0))
		{
			blanco=true;
		}
		return blanco;
	}
	
	
	
	
	
}
